// Image.cpp
//
#include "Image.h"

using namespace OpenGL;

//-------------------------------------------------------------------------------------------------
Image::Image()
: w(0),
  h(0),
  numCh(0),
  data(0)
{}


//-------------------------------------------------------------------------------------------------
Image::~Image()
{
	clear();
}

//-------------------------------------------------------------------------------------------------
void Image::create( int width, int height, int channels, void *pxl)
{
	w     = width;
	h     = height;
	numCh = channels;
	data  = pxl;
}

//-------------------------------------------------------------------------------------------------
void Image::clear()
{
	if(data) delete [] data;

	w     = 0;
	h     = 0;
	numCh = 0;
	data  = 0;
}